-
The
DingiFeatureprotocol is used to provide details about geographic features contained in anDingiShapeSourceorDingiVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
DingiShapeSourceusing the-[DingiShapeSource initWithIdentifier:shape:options:]method orDingiShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[DingiMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byDingiVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
DingiFeature-conforming objects to the map as annotations using-[DingiMapView addAnnotations:]and related methods, doing so has trade-offs:Features added as annotations will not have
identifierorattributesproperties when used with feature querying.Features added as annotations become interactive. Taps and selection can be handled in
-[DingiMapViewDelegate mapView:didSelectAnnotation:].
Declaration
Objective-C
@protocol DingiFeature <DingiAnnotation>Swift
protocol DingiFeature : DingiAnnotation -
An
DingiPointFeatureobject associates a point shape with an optional identifier and attributes.Declaration
Objective-C
@interface DingiPointFeature : DingiPointAnnotation <DingiFeature>Swift
class DingiPointFeature : DingiPointAnnotation, DingiFeature -
An
DingiPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface DingiPolygonFeature : DingiPolygon <DingiFeature>Swift
class DingiPolygonFeature : DingiPolygon, DingiFeature -
An
DingiPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Declaration
Objective-C
@interface DingiPolylineFeature : DingiPolyline <DingiFeature>Swift
class DingiPolylineFeature : DingiPolyline, DingiFeature -
An
DingiMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface DingiMultiPolygonFeature : DingiMultiPolygon <DingiFeature>Swift
class DingiMultiPolygonFeature : DingiMultiPolygon, DingiFeature -
An
DingiMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface DingiMultiPolylineFeature : DingiMultiPolyline <DingiFeature>Swift
class DingiMultiPolylineFeature : DingiMultiPolyline, DingiFeature -
An
DingiPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface DingiPointCollectionFeature : DingiPointCollection <DingiFeature>Swift
class DingiPointCollectionFeature : DingiPointCollection, DingiFeature -
An
DingiShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.DingiShapeCollectionFeatureis most commonly used to add multiple shapes to a singleDingiShapeSource. Configure the appearance of anDingiSource’s shape collection collectively using anDingiSymbolStyleLayerobject, or use multiple instances ofDingiCircleStyleLayer,DingiFillStyleLayer, andDingiLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Declaration
Objective-C
@interface DingiShapeCollectionFeature : DingiShapeCollection <DingiFeature>Swift
class DingiShapeCollectionFeature : DingiShapeCollection, DingiFeature
Style Primitives Reference